{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Hello, World!\n",
    "\n",
    "让我们从一个名为 [Hello, World!](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program) 这样一个传统程序开始！ \n",
    "\n",
    "下面是45年前Brian Kernighan第一次为C编程语言编写时的样子:\n",
    "\n",
    "```c\n",
    "main( ) {\n",
    "        printf(\"hello, world\\n\");\n",
    "}\n",
    "```\n",
    "\n",
    "现在轮到你了。 \n",
    "\n",
    "Jupyter笔记本是由许多单元格(cells)组成的。比如当前所在的这个单元格就是一个markdown单元格。Markdown单元格支持以Markdown语法来描述和记录代码。\n",
    "\n",
    "下面的单元格称为代码单元格。代码单元格可用于运行代码。下面的单元格中包含了用于*Hello, World!* 的代码。\n",
    "\n",
    "要运行下面的单元格，请按向下箭头(`Down`)键或单击上面工具栏中的 <button class=\"btn btn-default btn-xs\"><i class=\"fa-arrow-down fa\"></i></button>按钮将其选中。单元格周围的蓝色边框表示它现在处于焦点位置（被选中状态）。然后按`Shift-Enter` 组合键或单击上面工具栏中的<button class='btn btn-default btn-xs'><i class=\"icon-step-forward fa fa-step-forward\"></i></button>按钮来运行它。如果操作正确，代码将打印出著名的单词："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print('hello, world')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "干得好！\n",
    "\n",
    "现在，单击上面的 `帮助/Help` 菜单，从下拉列表中选择`用户界面教程/User Interface Tour`，这里简短介绍了Jupyter的用户界面。\n",
    "\n",
    "要编辑单元格的内容，请使用上(`Up`)下(`Down`)箭头键选择单元格，然后按`Enter`键。单元格边框的颜色应从蓝色变为绿色，以指示单元格处于编辑模式。\n",
    "\n",
    "编辑下面单元格的内容。将其更改为 `2 + 2`。完成后，按`Esc`键切换回命令模式，或按`Shift-Enter`组合键运行单元格。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "1 + 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "干得好！\n",
    "\n",
    "现在，浏览上面的菜单栏，了解如何操作周围的单元格。大多数操作都可以使用键盘快捷键。\n",
    "\n",
    "我又准备了几个单元格给你玩。你可以用这个笔记本练习你的技能。如果你是Python新手，我推荐[微软对Python的介绍](https://docs.microsoft.com/en-us/learn/modules/intro-to-python/1-introduction)。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a + 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "code_folding": []
   },
   "outputs": [],
   "source": [
    "for i in range(5):\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def greet(name):\n",
    "    print('Hello, ' + name + '!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "greet('Dave')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img style=\"float: left;\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/HAL9000.svg/240px-HAL9000.svg.png\">"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "nbTranslate": {
   "displayLangs": [
    "en"
   ],
   "hotkey": "alt-t",
   "langInMainMenu": true,
   "sourceLang": "en",
   "targetLang": "cn",
   "useGoogleTranslate": true
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "oldHeight": 122.85,
   "position": {
    "height": "144.85px",
    "left": "996px",
    "right": "20px",
    "top": "120px",
    "width": "350px"
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "varInspector_section_display": "block",
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
